<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<script>
    //【1】match方法会将匹配出来的数据以数组形式呈现。【字符串是调用主体】
    var str="The rain in SPAIN stays mainly in the plain"; 
    var n=str.match(/ain/g);
    console.log(n);//[ain,ain,ain]

</script>
</body>
</html>